HipAudioClip

Wraps a decoder onto it. Basically an easier interface with some more controls that would be needed inside specific APIs.

AudioClip flow basically consists in: 1. Initialize the audio clip with the current decoder. 2. Call .load, which calls .decode 3. HipAudioSource calls .setClip, which should call clip.getBuffer, which gets the buffer wrapped by the current implementation createBuffer, and then the buffer is enqueued.

Constructors

this
this(IHipAudioDecoder decoder, HipAudioClipHint hint)
Undocumented in source.
this
this(IHipAudioDecoder decoder, HipAudioClipHint hint, uint chunkSize)
Undocumented in source.

Members

Functions

_getBufferAPI
HipAudioBufferAPI* _getBufferAPI(ubyte[] data, uint size)
Undocumented in source. Be warned that the author may not have intended to support it.
createBuffer
HipAudioBufferWrapper createBuffer(ubyte[] data)

Always alocates a pointer to the buffer data. So, after getting its content. Send it to the recyclable buffers

destroyBuffer
void destroyBuffer(HipAudioBuffer* buffer)
Undocumented in source.
findBuffer
HipAudioBufferWrapper* findBuffer(HipAudioBuffer buf)
Undocumented in source. Be warned that the author may not have intended to support it.
getAudioClipBackend
IHipAudioClip getAudioClipBackend()
Undocumented in source. Be warned that the author may not have intended to support it.
getBuffer
HipAudioBuffer getBuffer(ubyte[] data, uint size)
Undocumented in source. Be warned that the author may not have intended to support it.
getClipData
ubyte[] getClipData()

Returns the streambuffer if streamed, else, returns entire sound

getClipSize
size_t getClipSize()

Returns how much has been decoded

getDecodedDuration
float getDecodedDuration()
Undocumented in source. Be warned that the author may not have intended to support it.
getDuration
float getDuration()
Undocumented in source. Be warned that the author may not have intended to support it.
getHint
immutable(HipAudioClipHint)* getHint()
Undocumented in source. Be warned that the author may not have intended to support it.
getSampleRate
uint getSampleRate()
Undocumented in source. Be warned that the author may not have intended to support it.
loadFromMemory
bool loadFromMemory(ubyte[] data, HipAudioEncoding encoding, HipAudioType type, void delegate(in ubyte[]) onSuccess, void delegate() onFailure)

Should implement the specific loading here

loadStreamed
uint loadStreamed(ubyte[] data, HipAudioEncoding encoding)

Saves which data should be decoded and do 1 decoding frame

onUpdateStream
void onUpdateStream(ubyte[] data, uint decodedSize)

Event method called when the stream is updated

pollFreeBuffer
HipAudioBuffer pollFreeBuffer()

Attempts to get a buffer from the buffer recycler. Used for when loadStreamed must set a buffer available

setBufferAvailable
void setBufferAvailable(HipAudioBuffer buffer)
Undocumented in source. Be warned that the author may not have intended to support it.
setBufferData
void setBufferData(HipAudioBuffer* buffer, ubyte[] data, uint size)

The buffer is actually any kind of external API buffer, it is the buffer contained in HipAudioBufferWrapper.

unload
void unload()
Undocumented in source. Be warned that the author may not have intended to support it.
updateStream
uint updateStream()

Decodes a bit more of the current buffer

Variables

chunkSize
uint chunkSize;

Unused for non streamed

dataToDecode
ubyte[] dataToDecode;

Unused for non streamed. It is the binary loaded from a file which will be decoded

decoder
IHipAudioDecoder decoder;
Undocumented in source.
encoding
HipAudioEncoding encoding;
Undocumented in source.
fileName
string fileName;
Undocumented in source.
hint
HipAudioClipHint hint;
Undocumented in source.
isStreamed
bool isStreamed;
Undocumented in source.
outBuffer
ubyte[] outBuffer;

Unused for non streamed. Where the user will get its audio decoded.

totalDecoded
size_t totalDecoded;
Undocumented in source.
type
HipAudioType type;
Undocumented in source.

Meta